<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script src="vue-2.5.21/dist/vue.js"></script>
	<style>
		.active{
			color: red;
		}
	</style>
</head>
<body>
	
	<div id="app">
		<ul>
			<li v-for="(item, index) in movies" :class="{active: currentIndex===index}" @click="liClick(index)">{{item}}</li>
		</ul>
	</div>
	<script>
		const app = new Vue({
			el: "#app",
			data: {
				movies: ["海王", "海贼王", "斗罗大陆"],
				currentIndex: 0,
			},
			methods: {
				liClick(index) {
					this.currentIndex = index;
				}
			},
			computed: {
				
			}
		});
	</script>
</body>
</html>